package com.ordos.recruit.module.apply.entity;

import com.wonders.commons.db.dic.validator.DicDb;
import com.wonders.commons.validation.phone.Phone;
import com.wonders.commons.validation.relate.idcard.IdCardRelated;
import com.wonders.commons.validation.relate.notblank.NotBlankConditionEnum;
import com.wonders.commons.validation.relate.notblank.NotBlankRelated;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 实体类, 申报请求参数。
 *
 * @author jin
 */
@Data
public class RecruitApplyDto {
    /**
     * 报名记录唯一标识
     */
    private String id;
    /**
     * 报名批次号
     */
    @NotBlank
    private String appliedNumber;
    /**
     * 申请职位代码
     * DIC_20250702_SQZW
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_20250702_SQZW", codeColumn = "code", message = "申请职位代码不在字典编码规范中.")
    @NotBlank
    private String appliedPositionCode;
    /**
     * 考生姓名
     */
    @NotBlankRelated(field = "id", value = "", condition = NotBlankConditionEnum.EQUALS, message = "当为新增时，考生姓名必须填写。")
    private String candidateName;
    /**
     * 性别代码
     * DIC_GB2261_1_2003
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_GB2261_1_2003", codeColumn = "code", message = "性别代码不在字典编码规范中.")
    @NotBlank
    private String genderCode;
    /**
     * 出生日期(YYYY-MM-DD)
     */
    @NotBlank
    private String birthDate;
    /**
     * 民族代码
     * DIC_GBT3304_1991
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_GBT3304_1991", codeColumn = "code", message = "民族代码不在字典编码规范中.")
    @NotBlank
    private String ethnicityCode;
    /**
     * 政治面貌代码
     * DIC_GBT4762_1984
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_GBT4762_1984", codeColumn = "code", message = "政治面貌代码不在字典编码规范中.")
    @NotBlank
    private String politicalAffiliationCode;
    /**
     * 证件类型
     * DIC_CV02_01_101
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_CV02_01_101", codeColumn = "code", message = "证件类型代码不在字典编码规范中.")
    @NotBlank
    private String idTypeCode;
    /**
     * 证件号码
     */
    @IdCardRelated(field = "idTypeCode", val = "01", message = "证件号码不符合规范")
    @NotBlankRelated(field = "id", value = "", condition = NotBlankConditionEnum.EQUALS, message = "当为新增时，证件号码必须填写。")
    private String idNumber;
    /**
     * 手机号码
     */
    @Phone
    @NotBlankRelated(field = "id", value = "", condition = NotBlankConditionEnum.EQUALS, message = "当为新增时，手机号码必须填写。")
    private String mobilePhone;
    /**
     * 紧急联系人姓名
     */
    @NotBlankRelated(field = "id", value = "", condition = NotBlankConditionEnum.EQUALS, message = "当为新增时，紧急联系人姓名必须填写。")
    private String emergencyContactName;
    /**
     * 紧急联系人电话
     */
    @Phone
    @NotBlankRelated(field = "id", value = "", condition = NotBlankConditionEnum.EQUALS, message = "当为新增时，紧急联系人电话必须填写。")
    private String emergencyContactPhone;
    /**
     * 现居住地省代码
     */
    @NotBlank
    private String currentAddressProvinceCode;
    /**
     * 现居住地市代码
     */
    @NotBlank
    private String currentAddressCityCode;
    /**
     * 现居住地地区代码
     */
    @NotBlank
    private String currentAddressDistrictCode;
    /**
     * 现居住地街道代码
     */
    @NotBlank
    private String currentAddressStreetCode;
    /**
     * 学历代码
     * DIC_GB4658_2006
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_GB4658_2006", codeColumn = "code", message = "学历代码不在字典编码规范中.")
    @NotBlank
    private String highestEducationCode;
    /**
     * 学历专业名称
     */
    @NotBlank
    private String highestEducationMajorName;
    /**
     * 学历获取方式代码
     * DIC_20250702_XLHQFS
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_20250702_XLHQFS", codeColumn = "code", message = "学历获取方式代码不在字典编码规范中.")
    @NotBlank
    private String highestEducationAcquireCode;
    /**
     * 教育类型代码
     * DIC_PT_XLHQFS
     */
    @DicDb(table = "d_dictionary_item", dicTypeColumn="d_id", dicType = "DIC_PT_XLHQFS", codeColumn = "code", message = "教育类型代码不在字典编码规范中.")
    @NotBlank
    private String educationFormCode;
    /**
     * 职位名称
     */
    @NotBlank
    private String positionName;
    /**
     * 奖惩情况描述
     */
    @NotBlank
    private String rewardsPunishmentsDesc;
    /**
     * 个人免冠照片文件ID
     */
    @NotBlank
    private String photoFileId;
    /**
     * 个人身份证正面文件id
     */
    @NotBlank
    private String idPhotoFrontFileId;
    /**
     * 个人身份证反面文件id
     */
    @NotBlank
    private String idPhotoVersoFileId;
    /**
     * 学历证书文件id
     */
    @NotBlank
    private String diplomaCertificateFileId;
    /**
     * 学位证书文件id
     */
    @NotBlank
    private String educationCertificateFileId;
    /**
     * 工作证明文件id
     */
    @NotBlank
    private String workExperienceCertificateId;
    /**
     * 专业技术资格证书证明材料文件id
     */
    @NotBlank
    private String professionalCertificateId;
    /**
     * 硕士研究生专业方向证明材料文件id
     */
    @NotBlank
    private String postgraduateDirectionFileId;
    /**
     * 承诺书文件id
     */
    @NotBlank
    private String integrityPledgeFileId;
    /**
     * 教育经历集合
     */
    @NotEmpty
    private List<StudyExperienceDto> studyExperienceList;
    /**
     * 工作经验集合
     */
    @NotEmpty
    private List<WorkExperienceDto> workExperienceList;
}
